<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Marker Manager V1.0 Reference</title>
<link rel="stylesheet" type="text/css" href="http://code.google.com/css/dev_docs.css"></link>
</head>
<body>
<h2>
<a name="MarkerManager"></a>class MarkerManager</h2>
<p>
    This class is used to manage visibility of hundreds of markers on a map,
    based on the map's current viewport and zoom level.
  </p>
<h3>Constructor</h3>
<table summary="class MarkerManager - Constructor">
<tbody><tr>
<th>Constructor</th>
<th>Description</th>
</tr>
<tr class="odd">
<td class="code">MarkerManager(<span class="type" title="type:  GMap">map</span>, <span class="type" title="type:  MarkerManagerOptions"> opts?</span>)</td>

<td>
        Creates a new marker manager that controlls visibility of
        markers for the specified map.
</td>
</tr>
</tbody></table>
<h3>Methods</h3>
<table summary="class MarkerManager - Methods">
<tbody><tr>
<th>Methods</th>
<th>Return Value</th>
<th>Description</th>
</tr>

<tr class="odd">
<td class="code">addMarkers(<span class="type" title="type:  Array of GMarker">markers</span>, <span class="type" title="type:  Number"> minZoom</span>, <span class="type" title="type:  Number"> maxZoom?</span>)</td>
<td class="code"><span class="void">none</span></td>
<td>
        Adds a batch of markers to this marker manager. The markers are not added
        to the map, until the <code><span class="nomatch">refresh()</span></code> method is called. Once
        placed on a map, the markers are shown if they fall within the map's
        current viewport and the map's zoom level is greater than or equal
        to the specified <code><span class="nomatch">minZoom</span></code>. If the <code><span class="nomatch">maxZoom</span></code>
        was given, the markers are automatically removed if the map's zoom
        is greater than the one specified.
</td>
</tr>
<tr class="even">
<td class="code">addMarker(<span class="type" title="type:  GMarker">marker</span>, <span class="type" title="type:  Number"> minZoom</span>, <span class="type" title="type:  Number"> maxZoom?</span>)</td>
<td class="code"><span class="void">none</span></td>

<td>
        Adds a single marker to a collection of markers controlled by this
        manager. If the marker's location falls within the map's current
        viewport and the map's zoom level is within the specified zoom level
        rage, the marker is immediately added to the map. Similar to the
        <code><span class="nomatch">addMarkers</span></code> method, the <code><span class="nomatch">minZoom</span></code> and the
        optional <code><span class="nomatch">maxZoom</span></code> parameters specify the range of zoom
        levels at which the marker is shown.
</td>
</tr>

<tr class="even">
<td class="code">removeMarker(<span class="type" title="type:  GMarker">marker</span>)</td>
<td class="code"><span class="void">none</span></td>
<td>
        Removes marker from the MarkerManager by
        searching at every zoom level to find grid cell
        that marker would be in, removing from that array if found.
        Also calls removeOverlay on marker if currently visible.
</td>
</tr>

<tr class="odd">
<td class="code">clearMarkers()</td>
<td class="code"><span class="void">none</span></td>
<td>
	Removes all currently displayed markers and clears grid arrays.
</td>
</tr>

<tr class="odd">
<td class="code">refresh()</td>

<td class="code"><span class="void">none</span></td>
<td>
        Forces the manager to update markers shown on the map. This method must
        be called if markers were added using the <code><span class="nomatch">addMarkers</span></code>
        method.
</td>
</tr>

<tr class="even">
<td class="code">getMarkerCount(<span class="type" title="type:  Number">zoom</span>)</td>
<td class="code"><span class="nomatch">Number</span></td>

<td>
        Returns the total number of markers potentially visible at the given
        zoom level. This may include markers at lower zoom levels.
</td>
</tr>
</tbody></table>
<h3>Events</h3>
<table summary="class MarkerManager - Events">
<tbody><tr>
<th>Events</th>
<th>Arguments</th>
<th>Description</th>
</tr>

<tr class="odd">
<td class="code">changed</td>
<td class="code">
<span class="type" title="type:  GBounds">bounds</span>, <span class="type" title="type:  Number"> markerCount</span>
</td>
<td>This event is fired when markers managed by a manager have been added
        to or removed from the map. The event handler function should be
        prepared to accept two arguments. The first one is the rectangle
        definining the bounds of the visible grid. The second one carries the
        number of markers currently shown on the map.
</td>
</tr>
</tbody></table>
<h2>
<a name="MarkerManagerOptions"></a>class MarkerManagerOptions</h2>

<p>This class represents optional arguments to the
  <code><span class="xref"><a href="#MarkerManager">MarkerManager</a></span></code> constructor. It has no constructor, but is
  instantiated as object literal.</p>
<h3>Properties</h3>
<table summary="class MarkerManagerOptions - Properties">
<tbody><tr>
<th>Properties</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr class="odd">

<td class="code">borderPadding</td>
<td class="code"> Number</td>
<td>
        Specifies, in pixels, the extra padding outside the map's current
        viewport monitored by a manager. Markers that fall within this
        padding are added to the map, even if they are not fully
        visible.
</td>
</tr>
<tr class="even">
<td class="code">maxZoom</td>
<td class="code"> Number</td>
<td>

        Sets the maximum zoom level monitored by a marker manager. If not
        given, the manager assumes the maximum map zoom level. This value is also
        used when markers are added to the manager without the optional
        <code><span class="nomatch">maxZoom</span></code> parameter.
</td>
</tr>
<tr class="odd">
<td class="code">trackMarkers</td>
<td class="code"> Boolean</td>
<td>
        Indicates whether or not a marker manager should track markers'
        movements. If you wish to move managed markers using the
        <code><span class="nomatch">setPoint</span></code> method, this option should be set to
        <code><span class="nomatch">true</span></code>. The default value is <code><span class="nomatch">false</span></code>.
</td>
</tr>
</tbody></table>
<h2>

</body>
</html>
